#!/bin/bash
# 备份指定目录到目标目录
SOURCE_DIR="/path/to/source"
BACKUP_DIR="/path/to/backup"
TIMESTAMP=$(date +"%Y%m%d%H%M")

tar -czf "$BACKUP_DIR/backup_$TIMESTAMP.tar.gz" "$SOURCE_DIR"
echo "备份完成: $BACKUP_DIR/backup_$TIMESTAMP.tar.gz"
